import Layout from '@/layout/index.vue';

export const asyncRoutes = [
  {
    path: '/propety',
    component: Layout,
    permission: 'property',
    children: [
      {
        path: 'cost',
        component: () => import('@/views/propety/cost.vue'),
        meta: { title: '物业费管理', icon: 'propety' },
        permission: 'property:propertyFee',
      },
    ],
  },

  {
    path: '/park',
    component: Layout,
    redirect: '/park/building',
    permission: 'park',
    meta: { title: '园区管理', icon: 'park' },
    children: [
      {
        path: 'building',
        component: () => import('@/views/park/building/building.vue'),
        meta: { title: '楼宇管理' },
        permission: 'park:building',
      },
      {
        path: 'enterprise',
        component: () => import('@/views/park/enterprise/enterprise.vue'),
        meta: { title: '企业管理' },
        permission: 'park:enterprise',
      },
    ],
  },

  {
    path: '/rod',
    component: Layout,
    redirect: '/rod/manage',
    permission: 'pole',
    meta: {
      title: '门禁管理',
      icon: 'rod',
    },
    children: [
      {
        path: 'manage',
        component: () => import('@/views/rod/manage/manage.vue'),
        meta: { title: '一体杆管理' },
        permission: 'pole:info',
      },
      {
        path: 'warnList',
        component: () => import('@/views/rod/warnList/warnList.vue'),
        meta: { title: '告警管理' },
        permission: 'pole:warning',
      },
    ],
  },

  {
    path: '/system',
    component: Layout,
    redirect: '/system/employee',
    meta: { title: '系统管理', icon: 'system' },
    permission: 'sys',
    children: [
      {
        path: 'employee',
        component: () => import('@/views/system/employee/employee.vue'),
        meta: { title: '员工管理' },
        permission: 'sys:user',
      },
      {
        path: 'role',
        component: () => import('@/views/system/role/role.vue'),
        meta: { title: '角色管理' },
        permission: 'sys:role',
      },
      {
        path: 'roleForm',
        component: () => import('@/views/system/role/components/roleForm.vue'),
        meta: { title: '角色操作' },
        hidden: true,
      },
    ],
  },

  {
    path: '/car',
    component: Layout,
    redirect: '/car/area',
    meta: { title: '行车管理', icon: 'car' },
    permission: 'parking',
    children: [
      {
        path: 'area',
        component: () => import('@/views/car/area/area.vue'),
        meta: { title: '区域管理' },
        permission: 'parking:area',
      },
      {
        path: 'monthCard',
        component: () => import('@/views/car/monthCard/monthCard.vue'),
        meta: { title: '月卡管理' },
        permission: 'parking:card',
      },
      {
        path: 'pay',
        component: () => import('@/views/car/pay/pay.vue'),
        meta: { title: '停车缴费管理' },
        permission: 'parking:payment',
      },
      {
        path: 'billing',
        component: () => import('@/views/car/billing/billing.vue'),
        meta: { title: '计费规则管理' },
        permission: 'parking:rule',
      },

    ],
  },

  {
    path: '/controlsCard',
    component: () => import('@/views/car/monthCard/components/controlsCard.vue'),
  },
];
